package edu.mju.service.impl;

import edu.mju.dao.IOrderDao;
import edu.mju.dao.impl.OrderDaoImpl;
import edu.mju.entity.Order;
import edu.mju.service.IOrderService;
import edu.mju.util.Pager;

import java.util.List;

/**
 * @Author:wyp
 * @Date:2020/5/27 23:20
 */
public class OrderServiceImpl implements IOrderService {
    IOrderDao orderDao = new OrderDaoImpl();

    @Override
    public boolean deleteOrder(Integer orderId) {
        return orderDao.deleteOrder(orderId);
    }

    @Override
    public boolean insert(Order order) {
        boolean Isinsert = orderDao.insert(order);
        return Isinsert;
    }

    @Override
    public Pager findByTouristId(int page, int pageSize,Integer touristId) {
        Pager pager = orderDao.pagenate(page,pageSize,touristId);
        return pager;
    }

    @Override
    public Pager findByUserId(int page, int pageSize, Integer userId) {
        Pager pager =orderDao.findByUserId(page,pageSize,userId);
        return pager;
    }
}
